package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Cartitem generated by hbm2java
 */
@Entity
@Table(name = "cartitem", catalog = "shop")
public class Cartitem implements java.io.Serializable {

	private Integer cartitemId;
	private SkuProd skuProd;
	private Customer customer;
	private int cartitemQuantity;
	private String cartitemUuid;
	private Date cartitemDate;

	public Cartitem() {
	}

	public Cartitem(SkuProd skuProd, Customer customer, int cartitemQuantity,
			String cartitemUuid, Date cartitemDate) {
		this.skuProd = skuProd;
		this.customer = customer;
		this.cartitemQuantity = cartitemQuantity;
		this.cartitemUuid = cartitemUuid;
		this.cartitemDate = cartitemDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "cartitem_id", unique = true, nullable = false)
	public Integer getCartitemId() {
		return this.cartitemId;
	}

	public void setCartitemId(Integer cartitemId) {
		this.cartitemId = cartitemId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "skuprod_id", nullable = false)
	public SkuProd getSkuProd() {
		return this.skuProd;
	}

	public void setSkuProd(SkuProd skuProd) {
		this.skuProd = skuProd;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cust_id", nullable = false)
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Column(name = "cartitem_quantity", nullable = false)
	public int getCartitemQuantity() {
		return this.cartitemQuantity;
	}

	public void setCartitemQuantity(int cartitemQuantity) {
		this.cartitemQuantity = cartitemQuantity;
	}

	@Column(name = "cartitem_uuid", nullable = false, length = 32)
	public String getCartitemUuid() {
		return this.cartitemUuid;
	}

	public void setCartitemUuid(String cartitemUuid) {
		this.cartitemUuid = cartitemUuid;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "cartitem_date", nullable = false, length = 19)
	public Date getCartitemDate() {
		return this.cartitemDate;
	}

	public void setCartitemDate(Date cartitemDate) {
		this.cartitemDate = cartitemDate;
	}

}
